<div class="form">
  <% form_for @user,:html=>{:id=>"user_form"} do |f| -%>
    <% unless @user.id %>
      <p><label for="rc">推荐码</label>
        <input name="rc" title="推荐码不存在" size="15"></input>
        <span class="tips">
          <span style="color:red;">*</span> 推荐码.（<a href="/store/fqa#howtojoin">如何获得推荐码？</a>）.
        </span>
      </p>
      <p><label for="login">账号</label>
        <%= f.text_field :login,:title=>"3-20位,字母数字组合.",:size=>15 %>
        <span class="tips">
          <span style="color:red;">*</span> 3-20位,英文字母加数字组合.
        </span>
      </p>
    <%end%>
    <p><label for="email">Email</label>
      <%= f.text_field :email,:title=>"请输入正确格式的电子邮件.",:size=>20 %>
      <span class="tips">
        <span style="color:red;">*</span> 常用的邮箱.
      </span>
    </p>
    <% unless @user.id %>
      <p><label for="password">密码</label>
        <%= f.password_field :password,:title=>"密码格式不正确",:size=>15 %>
        <span class="tips">
          <span style="color:red;">*</span> 5-20位,字母数字特殊符号组合.
        </span>
      </p>

      <p><label for="password_confirmation">密码确认</label>
        <%= f.password_field :password_confirmation,:title=>"密码不一致",:size=>15 %>
        <span class="tips">
          <span style="color:red;">*</span> 重复密码
        </span>
      </p>
    <%  end %>
    <p><label for="nickname">昵称</label>
      <%= f.text_field :nickname,:title=>"3-20位,中文或英文字母组合.",:size=>15 %>
      <span class="tips">
        3-20位,中文或英文字母组合.
      </span>
    </p>

    <p>
      <label for="sex">性别</label>
      <%=select("user", "sex",User::SEX,:prompt => "请选择..")%>
    </p>


    <p style="text-align:left;padding-left:50px;">
      <% unless @user.id %>
        <%= image_submit_tag('/images/register.jpg',:style=>"border:none;",:alt=>"确定")%>
      <%else%>

        <%= image_submit_tag('/images/save.jpg',:style=>"border:none;",:alt=>"保存")%>
      <%end%>
    </p>

  <% end -%>
</div>
